<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Format
 *
 * @author thuan_000
 */
class Format {
    const ORDER_PREFIX = "FORM_";

    //put your code here
    public static function getOderId($form_id) {
        return Format::ORDER_PREFIX.$form_id;
    }
    public static function getFormId($order_id) {
        return str_replace(Format::ORDER_PREFIX, '', $order_id);
    }
    public static function getFormLink($id,$form_type,$action='view') {
        switch ($form_type) {
            case FormData::THONG_BAO_MOI_THAU:
                return Yii::app()->createAbsoluteUrl("thongbaomoithau/{$action}", array('id'=>$id));
                break;
            case FormData::KET_QUA_DAU_THAU:
                return Yii::app()->createAbsoluteUrl("ketquadauthau/{$action}", array('id'=>$id));
                break;
            default:
                break;
        }
    }
}
